#coding=utf-8
import _prepare
from services import subscribe,user,recommand
from orm import Model


if __name__=='__main__':
    need_to_build = [subscribe,user,recommand]
    for module in need_to_build:
        each_build = []
        for key,value in vars(module.model).items():
            if hasattr(value,'__base__') and value.__base__ is Model:
                each_build.append(value)
        for n in each_build:

            if not n.status():
                print 'building %s' % n._table
                n.create_table()

